package com.dz.reggie.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dz.reggie.entity.OrderDetail;
import com.dz.reggie.entity.Orders;
import com.dz.reggie.mapper.OrderDetailMapper;
import com.dz.reggie.service.OrderDetailService;
import org.springframework.stereotype.Service;

import java.util.HashMap;

@Service
public class OrderDetailServiceImpl extends ServiceImpl<OrderDetailMapper, OrderDetail> implements OrderDetailService {

    /**
     * 根据订单id查询详情
     * @param orderId
     * @return
     */
    @Override
    public OrderDetail getByOrderId(Long orderId) {
        LambdaQueryWrapper<OrderDetail> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(OrderDetail::getOrderId, orderId);
        OrderDetail orderDetail = this.getOne(lambdaQueryWrapper);

        return orderDetail;
    }


}
